<template>
  <div class="nav-bar">
    NavBar
    <el-button @click="remove">清除</el-button>
    <el-button @click="add">新增</el-button>
    <el-button @click="back">后台</el-button>
  </div>
</template>
<script>
export default {
  name: "NavBar",
  data() {
    return {};
  },
  mounted() {},
  methods: {
    remove() {
      this.$map.removeLayers();
    },
    add() {
      this.$map.addLayers([
        this.$map.createPointsLayer("point", [
          [120 + Math.random(), 30 + Math.random()],
          [120 - Math.random(), 30 - Math.random()],
        ]),
      ]);
    },
    back() {
      this.$router.push("/");
    },
  },
};
</script>
<style lang="scss" scoped>
.nav-bar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 40px;
  border: 1px solid red;
  z-index: 10;
}
</style>
